package com.smile.service.entity.device.manager;


import com.alibaba.fastjson2.annotation.JSONField;

import java.io.Serializable;
import java.util.List;

public class TopologyUpdateData implements Serializable {

    private static final long serialVersionUID = 1L;

    @JSONField(name = "domain")
    private String domain;

    @JSONField(name = "type")
    private int type;

    @JSONField(name = "sub_type")
    private int subType;

    @JSONField(name = "device_secret")
    private String deviceSecret;

    @JSONField(name = "nonce")
    private String nonce;

    @JSONField(name = "thing_version")
    private String thingVersion;

    @JSONField(name = "sub_devices")
    private List<SubDevice> subDevices;

    // 嵌套类 - 子设备信息
    public static class SubDevice {
        @JSONField(name = "sn")
        private String sn;

        @JSONField(name = "domain")
        private String domain;

        @JSONField(name = "type")
        private int type;

        @JSONField(name = "sub_type")
        private int subType;

        @JSONField(name = "index")
        private String index;

        @JSONField(name = "device_secret")
        private String deviceSecret;

        @JSONField(name = "nonce")
        private String nonce;

        @JSONField(name = "thing_version")
        private String thingVersion;

        // Getters & Setters
        public String getSn() {
            return sn;
        }

        public void setSn(String sn) {
            this.sn = sn;
        }

        public String getDomain() {
            return domain;
        }

        public void setDomain(String domain) {
            this.domain = domain;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public int getSubType() {
            return subType;
        }

        public void setSubType(int subType) {
            this.subType = subType;
        }

        public String getIndex() {
            return index;
        }

        public void setIndex(String index) {
            this.index = index;
        }

        public String getDeviceSecret() {
            return deviceSecret;
        }

        public void setDeviceSecret(String deviceSecret) {
            this.deviceSecret = deviceSecret;
        }

        public String getNonce() {
            return nonce;
        }

        public void setNonce(String nonce) {
            this.nonce = nonce;
        }

        public String getThingVersion() {
            return thingVersion;
        }

        public void setThingVersion(String thingVersion) {
            this.thingVersion = thingVersion;
        }

        @Override
        public String toString() {
            return "SubDevice{" +
                    "sn='" + sn + '\'' +
                    ", domain='" + domain + '\'' +
                    ", type=" + type +
                    ", subType=" + subType +
                    ", index='" + index + '\'' +
                    ", deviceSecret='[PROTECTED]'" +
                    ", nonce='[PROTECTED]'" +
                    ", thingVersion='" + thingVersion + '\'' +
                    '}';
        }
    }

    // Getters & Setters
    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSubType() {
        return subType;
    }

    public void setSubType(int subType) {
        this.subType = subType;
    }

    public String getDeviceSecret() {
        return deviceSecret;
    }

    public void setDeviceSecret(String deviceSecret) {
        this.deviceSecret = deviceSecret;
    }

    public String getNonce() {
        return nonce;
    }

    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    public String getThingVersion() {
        return thingVersion;
    }

    public void setThingVersion(String thingVersion) {
        this.thingVersion = thingVersion;
    }

    public List<SubDevice> getSubDevices() {
        return subDevices;
    }

    public void setSubDevices(List<SubDevice> subDevices) {
        this.subDevices = subDevices;
    }

    @Override
    public String toString() {
        return "TopologyUpdateData{" +
                "domain='" + domain + '\'' +
                ", type=" + type +
                ", subType=" + subType +
                ", deviceSecret='[PROTECTED]'" +
                ", nonce='[PROTECTED]'" +
                ", thingVersion='" + thingVersion + '\'' +
                ", subDevices=" + subDevices +
                '}';
    }
}